Add sending domain update and company info endpoints - #70
Merged
Conversation
Fills the gap against the OpenAPI spec: PATCH on a domain plus the
nested company_info GET/POST/PATCH.
Company info is its own resource on sendingApi().companyInfo(). The spec
path is /api/domains/{id}/company_info and the account comes from the
API token, so it takes no accountId. Its methods return the
CompanyInfoResponse envelope rather than unwrapping it, matching
Webhooks and the rest of this SDK.
Adding the field to MailtrapEmailSendingApi changes its Lombok
@requiredargsconstructor signature, so the factory call is updated with
it.
Also adds tracking_opt_out_enabled to SendingDomainsResponse. The API
returns it and update() writes it, so callers could not read back what
they just set.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
mklocek
marked this pull request as ready for review
August 25, 2026 14:21
piobeny
approved these changes
Aug 26, 2026
leonid-shevtsov
approved these changes
Aug 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Adds the sending-domain update endpoint and the nested
company_infoendpoints, which exist in the API (peremail-sending.openapi.yml) but were missing from the SDK.SendingDomains.update—PATCHon the domain, withUpdateSendingDomainRequestcoveringopen_tracking_enabled,click_tracking_enabled,tracking_opt_out_enabled,auto_unsubscribe_link_enabledandinbound_enabled. The inner data class usesBooleanwith@Builderand@JsonInclude(NON_NULL), so only the fields a caller sets are serialized and an explicitfalsesurvives.CompanyInfo/CompanyInfoImpl— new resource onclient.sendingApi().companyInfo()withgetCompanyInfo/createCompanyInfo/updateCompanyInfo. The spec path is/api/domains/{domain_id}/company_infoand the account is resolved from the API token, so it takes noaccountId.CompanyInfoResponseenvelope and callers read.getData(), matchingWebhooksand the rest of this SDK rather than unwrapping in the impl.model/request/companyinfo/{Create,Update}CompanyInfoRequestandmodel/response/companyinfo/{CompanyInfo,CompanyInfoResponse}.SendingDomainsResponse— addtracking_opt_out_enabled. The API returns it andupdatewrites it, so callers could not read back what they had just set. Both domain fixtures were updated to include it.companyInfofield toMailtrapEmailSendingApichanges its Lombok@RequiredArgsConstructorsignature, soMailtrapClientFactory.createSendingApiis updated in the same change.CompanyInfoImplTestplus anupdatecase inSendingDomainsImplTest, four new fixtures, a newCompanyInfoExample, an update block inSendingDomainsExample, and README entries.updateon the domain itself stays on the account-scoped/api/accounts/{accountId}/sending_domains/{id}route with thesending_domainwrapper, consistent withcreate/get/deleteon the same resource; the API accepts both that and the spec's account-less form.